Azure Maps Search Service (stable:2025-01-01)

2025/10/14 • 2 updated methods

Search_GetGeocoding (updated)
Description The `Get Geocoding` API is an HTTP `GET` request that returns the longitude and latitude coordinates of the location being searched. In many cases, the complete search service might be too much, for instance if you are only interested in traditional geocoding. Search can also be accessed for address look up exclusively. The geocoding is performed by hitting the geocoding endpoint with just the address or partial address in question. The geocoding search index will be queried for everything above the street level data. No Point of Interest (POIs) will be returned. Note that the geocoder is very tolerant of typos and incomplete addresses. It will also handle everything from exact street addresses or street or intersections as well as higher level geographies such as city centers, counties and states. The response also returns detailed address properties such as street, postal code, municipality, and country/region information.
Reference Link ¶

⚶ Changes

{
  "#id": "Search_GetGeocoding",
  "$parameters": [
    {
      "#name": "addressLine",
      "Description": {
        "new": "The official street line of an address relative to the area, as specified by the locality, or postalCode, properties. Typical use of this element would be to provide a street address or any official address.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
        "old": "The official street line of an address relative to the area, as specified by the locality, or postalCode, properties. Typical use of this element would be to provide a street address or any official address.\n\n**If query is given, should not use this parameter.**"
      }
    },
    {
      "#name": "countryRegion",
      "Description": {
        "new": "Signal for the geocoding result to an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) that is specified e.g. FR./\n\nThis parameter should not be used when the `query` parameter is included in the request.",
        "old": "Signal for the geocoding result to an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) that is specified e.g. FR./\n\n**If query is given, should not use this parameter.**"
      }
    },
    {
      "#name": "adminDistrict",
      "Description": {
        "new": "The country subdivision portion of an address, such as WA.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
        "old": "The country subdivision portion of an address, such as WA.\n\n**If query is given, should not use this parameter.**"
      }
    },
    {
      "#name": "adminDistrict2",
      "Description": {
        "new": "The county for the structured address, such as King.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
        "old": "The county for the structured address, such as King.\n\n**If query is given, should not use this parameter.**"
      }
    },
    {
      "#name": "adminDistrict3",
      "Description": {
        "new": "The named area for the structured address.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
        "old": "The named area for the structured address.\n\n**If query is given, should not use this parameter.**"
      }
    },
    {
      "#name": "locality",
      "Description": {
        "new": "The locality portion of an address, such as Seattle.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
        "old": "The locality portion of an address, such as Seattle.\n\n**If query is given, should not use this parameter.**"
      }
    },
    {
      "#name": "postalCode",
      "Description": {
        "new": "The postal code portion of an address.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
        "old": "The postal code portion of an address.\n\n**If query is given, should not use this parameter.**"
      }
    }
  ]
}

⚼ Request

GET:  /geocode
{
api-version: string ,
Accept-Language: string ,
top: integer ,
query: string ,
addressLine: string ,
countryRegion: string ,
bbox: array ,
view: string ,
coordinates: array ,
adminDistrict: string ,
adminDistrict2: string ,
adminDistrict3: string ,
locality: string ,
postalCode: string ,
x-ms-client-id: string ,
}

⚐ Response (200)

{
$headers:
{
x-ms-request-id: string ,
}
,
$schema:
{
type: enum ,
features:
[
{
type: enum ,
id: string ,
properties:
{
type: string ,
confidence: enum ,
matchCodes:
[
string ,
]
,
address:
{
addressLine: string ,
locality: string ,
neighborhood: string ,
adminDistricts:
[
{
name: string ,
shortName: string ,
}
,
]
,
postalCode: string ,
countryRegion:
{
ISO: string ,
name: string ,
}
,
formattedAddress: string ,
streetName: string ,
streetNumber: string ,
intersection:
{
baseStreet: string ,
secondaryStreet1: string ,
secondaryStreet2: string ,
intersectionType: string ,
displayName: string ,
}
,
}
,
geocodePoints:
[
{
geometry: object ,
calculationMethod: enum ,
usageTypes:
[
string ,
]
,
}
,
]
,
}
,
geometry: object ,
bbox:
[
number ,
]
,
}
,
]
,
nextLink: string ,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}
Search_GetGeocodingBatch (updated)
Description The `Get Geocoding Batch` API is an HTTP `POST` request that sends batches of up to **100** queries to the [Geocoding](/rest/api/maps/search/get-geocoding) API in a single request. ### Submit Synchronous Batch Request The Synchronous API is recommended for lightweight batch requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later. The Synchronous API will return a timeout error (a 408 response) if the request takes longer than 60 seconds. The number of batch items is limited to **100** for this API. ``` POST https://atlas.microsoft.com/geocode:batch?api-version=2023-06-01 ``` ### POST Body for Batch Request To send the _geocoding_ queries you will use a `POST` request where the request body will contain the `batchItems` array in `json` format and the `Content-Type` header will be set to `application/json`. Here's a sample request body containing 2 _geocoding_ queries: ``` { "batchItems": [ { "addressLine": "One, Microsoft Way, Redmond, WA 98052", "top": 2 }, { "addressLine": "Pike Pl", "adminDistrict": "WA", "locality": "Seattle", "top": 3 } ] } ``` A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](/rest/api/maps/search/get-geocoding#uri-parameters). The batch should contain at least **1** query. ### Batch Response Model The batch response contains a `summary` component that indicates the `totalRequests` that were part of the original batch request and `successfulRequests` i.e. queries which were executed successfully. The batch response also includes a `batchItems` array which contains a response for each and every query in the batch request. The `batchItems` will contain the results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - [`GeocodingResponse`](/rest/api/maps/search/get-geocoding#geocodingresponse) - If the query completed successfully. - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
Reference Link ¶

⚶ Changes

{
  "#id": "Search_GetGeocodingBatch",
  "$parameters": {
    "geocodingBatchRequestBody": {
      "$properties": {
        "batchItems": {
          "$properties": [
            {
              "#name": "addressLine",
              "Description": {
                "new": "The official street line of an address relative to the area, as specified by the locality, or postalCode, properties. Typical use of this element would be to provide a street address or any official address.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
                "old": "The official street line of an address relative to the area, as specified by the locality, or postalCode, properties. Typical use of this element would be to provide a street address or any official address.\n\n**If query is given, should not use this parameter.**"
              }
            },
            {
              "#name": "countryRegion",
              "Description": {
                "new": "Signal for the geocoding result to an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) that is specified e.g. FR./\n\nThis parameter should not be used when the `query` parameter is included in the request.",
                "old": "Signal for the geocoding result to an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) that is specified e.g. FR./\n\n**If query is given, should not use this parameter.**"
              }
            },
            {
              "#name": "adminDistrict",
              "Description": {
                "new": "The country subdivision portion of an address, such as WA.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
                "old": "The country subdivision portion of an address, such as WA.\n\n**If query is given, should not use this parameter.**"
              }
            },
            {
              "#name": "adminDistrict2",
              "Description": {
                "new": "The county for the structured address, such as King.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
                "old": "The county for the structured address, such as King.\n\n**If query is given, should not use this parameter.**"
              }
            },
            {
              "#name": "adminDistrict3",
              "Description": {
                "new": "The named area for the structured address.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
                "old": "The named area for the structured address.\n\n**If query is given, should not use this parameter.**"
              }
            },
            {
              "#name": "locality",
              "Description": {
                "new": "The locality portion of an address, such as Seattle.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
                "old": "The locality portion of an address, such as Seattle.\n\n**If query is given, should not use this parameter.**"
              }
            },
            {
              "#name": "postalCode",
              "Description": {
                "new": "The postal code portion of an address.\n\nThis parameter should not be used when the `query` parameter is included in the request.",
                "old": "The postal code portion of an address.\n\n**If query is given, should not use this parameter.**"
              }
            }
          ]
        }
      }
    }
  }
}

⚼ Request

POST:  /geocode:batch
{
x-ms-client-id: string ,
api-version: string ,
Accept-Language: string ,
geocodingBatchRequestBody:
{
batchItems:
[
{
optionalId: string ,
top: integer ,
query: string ,
addressLine: string ,
countryRegion: string ,
bbox:
[
number ,
]
,
view: string ,
coordinates:
[
number ,
]
,
adminDistrict: string ,
adminDistrict2: string ,
adminDistrict3: string ,
locality: string ,
postalCode: string ,
}
,
]
,
}
,
}

⚐ Response (200)

{
summary:
{
successfulRequests: integer ,
totalRequests: integer ,
}
,
batchItems:
[
{
optionalId: string ,
type: enum ,
features:
[
{
type: enum ,
id: string ,
properties:
{
type: string ,
confidence: enum ,
matchCodes:
[
string ,
]
,
address:
{
addressLine: string ,
locality: string ,
neighborhood: string ,
adminDistricts:
[
{
name: string ,
shortName: string ,
}
,
]
,
postalCode: string ,
countryRegion:
{
ISO: string ,
name: string ,
}
,
formattedAddress: string ,
streetName: string ,
streetNumber: string ,
intersection:
{
baseStreet: string ,
secondaryStreet1: string ,
secondaryStreet2: string ,
intersectionType: string ,
displayName: string ,
}
,
}
,
geocodePoints:
[
{
geometry: object ,
calculationMethod: enum ,
usageTypes:
[
string ,
]
,
}
,
]
,
}
,
geometry: object ,
bbox:
[
number ,
]
,
}
,
]
,
nextLink: string ,
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}